package com.zyh.kaoshi.test1;

import com.zyh.kaoshi.test1.domain.Dog;

import java.util.ArrayList;

/**
 * @Author zyh
 * @Date 2024/8/3 12:01
 * @Description 使用集合存储多个狗狗的信息（至少4个），狗狗类的属性昵称，品种和健康值
 */

public class Test01 {
    public static void main(String[] args) {
        ArrayList<Dog> list = new ArrayList<>();
        list.add(new Dog("cxk","中华田园犬",99));
        list.add(new Dog("dz","藏獒",59));
        list.add(new Dog("wy","普通狗",96));
        list.add(new Dog("ld","贵族狗",23));
        System.out.println("健康值小于60的狗信息如下");
        for (Dog dog : list) {
            if (dog.getHealthValue()<60){
                System.out.println("昵称 "+dog.getName()+"品种 "+dog.getBreed()+"健康值 "+dog.getHealthValue());
            }
        }
    }
}
